﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Callee.aspx.cs" Inherits="Callee" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>AAA</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.3.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <table>
        <tbody>
          <tr>
            <th>Name</th>
            <td>
              <asp:TextBox ID="tbName" runat="server" />
            </td>
          </tr>
          <tr>
            <th>No</th>
            <td>
              <asp:TextBox ID="tbID" runat="server" />
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div>
      <asp:Button ID="btnSave" runat="server" Text="Save" />
      <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
    </div>
    </form>
    
    <script type="text/javascript">
      
      $(function() {
      
        LoadUserInfo();
        
        function LoadUserInfo()
        {
          var CallerInfo=window.CallerInfo;

          var UserInfo=CallerInfo.UserInfo;

          UserInfo.Name=$('#tbName').val(UserInfo.Name);
          UserInfo.ID=$('#tbID').val(UserInfo.ID);
        }
        
        $('#btnSave').click(function(){
          
          var CallerInfo=window.CallerInfo;

          var UserInfo=CallerInfo.UserInfo;
          
          var SaveUserInfo=CallerInfo.SaveUserInfo;
        
          UserInfo.Name=$('#tbName').val();
          UserInfo.ID=$('#tbID').val();
          
          SaveUserInfo(UserInfo);

          window.close();

          return false;
        });

        $('#btnCancel').click(function() {

          window.close();

          return false;
        });
      });
    </script>
</body>
</html>
